package chances.wechat.entity;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class ScheduleOrder extends ContentBase implements java.io.Serializable {

	private static final long serialVersionUID = 3094877505815686594L;

	public final static Integer PAUSE_STATUS = 0;

	public final static Integer EXEC_STATUS = 1; // 已执行
	public final static Integer EXEC_STATUS_NO = 0; // 未执行

	protected Long subId;
	protected Integer execStatus;
	protected Integer subType;
	protected String stbNo;
	protected Date nextDate;
	protected Date endDate;

	public Long getSubId() {
		return subId;
	}

	public void setSubId(Long subId) {
		this.subId = subId;
	}

	public Integer getSubType() {
		return subType;
	}

	public void setSubType(Integer subType) {
		this.subType = subType;
	}

	public Date getNextDate() {
		return nextDate;
	}

	public void setNextDate(Date nextDate) {
		this.nextDate = nextDate;
	}

	public void setNextDate(String nextDate) {
		this.nextDate = getDate(nextDate);
	}

	public Integer getExecStatus() {
		return execStatus;
	}

	public void setExecStatus(Integer execStatus) {
		this.execStatus = execStatus;
	}

	public String getStbNo() {
		return stbNo;
	}

	public void setStbNo(String stbNo) {
		this.stbNo = stbNo;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public void setEndDate(String endDate) {
		this.endDate = getDate(endDate);
	}

	public Date getDate(String timeStr) {
		Date time = null;
		SimpleDateFormat slf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		try {
			time = slf.parse(timeStr);
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return time;
	}

}
